package to;


public class BeansTO {
	private int no;
	private String date;//입고일자
	private String enterprise;//회사
	private int cost;//가격
	private int UnitCost;//단가
	private int weight;//중량
	private String quality;//품질
	private double evaluationGrade;//평가점수
	private int foreign;//이물질률
	
	public BeansTO() {
		enterprise = ((char)((Math.random()*25)+65))+"."+((char)((Math.random()*25)+65))+"."+((char)((Math.random()*25)+65))+"사";
		weight = (int) ((Math.random()*100)+3000);
		cost = (int) ((Math.random()*3000000)+27000000);
	}

	public int getNo() {
		return no;
	}

	public void setNo(int no) {
		this.no = no;
	}

	public String getDate() {
		return date;
	}

	public void setDate(String date) {
		this.date = date;
	}

	public String getEnterprise() {
		return enterprise;
	}

	public void setEnterprise(String enterprise) {
		this.enterprise = enterprise;
	}

	public int getWeight() {
		return weight;
	}

	public void setWeight(int weight) {
		this.weight = weight;
	}

	public int getCost() {
		return cost;
	}

	public void setCost(int cost) {
		this.cost = cost;
	}

	public int getUnitCost() {
		return UnitCost;
	}

	public void setUnitCost(int unitCost) {
		UnitCost = unitCost;
	}

	public String getQuality() {
		return quality;
	}

	public void setQuality(String quality) {
		this.quality = quality;
	}

	public int getForeign() {
		return foreign;
	}

	public void setForeign(int foreign) {
		this.foreign = foreign;
	}

	public double getEvaluationGrade() {
		return evaluationGrade;
	}

	public void setEvaluationGrade(double evaluationGrade) {
		this.evaluationGrade = evaluationGrade;
	}

	@Override
	public String toString() {
		return "BeansTO [no=" + no + ", enterprise=" + enterprise + ", weight="
				+ weight + ", cost=" + cost + ", UnitCost=" + UnitCost
				+ ", quality=" + quality + ", foreign=" + foreign
				+ ", evaluationGrade=" + evaluationGrade + ", date=" + date
				+ "]";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + UnitCost;
		result = prime * result + cost;
		result = prime * result + ((date == null) ? 0 : date.hashCode());
		result = prime * result
				+ ((enterprise == null) ? 0 : enterprise.hashCode());
		long temp;
		temp = Double.doubleToLongBits(evaluationGrade);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		result = prime * result + foreign;
		result = prime * result + no;
		result = prime * result + weight;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		BeansTO other = (BeansTO) obj;
		if (UnitCost != other.UnitCost)
			return false;
		if (cost != other.cost)
			return false;
		if (date == null) {
			if (other.date != null)
				return false;
		} else if (!date.equals(other.date))
			return false;
		if (enterprise == null) {
			if (other.enterprise != null)
				return false;
		} else if (!enterprise.equals(other.enterprise))
			return false;
		if (Double.doubleToLongBits(evaluationGrade) != Double
				.doubleToLongBits(other.evaluationGrade))
			return false;
		if (foreign != other.foreign)
			return false;
		if (no != other.no)
			return false;
		if (quality != other.quality)
			return false;
		if (weight != other.weight)
			return false;
		return true;
	}
	
	
	
}
